<%@page import="com.tt.control.UserManager"%>
<%@page import="java.sql.Timestamp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="com.tt.shpping.*" %>

<%
User user = (User)session.getAttribute("user");
if(user == null) {
	out.print("you haven't login");
	response.sendRedirect("userlogin.jsp");
	return;
}
%>
<%
request.setCharacterEncoding("utf-8");
String action = request.getParameter("action");
if(action !=null && action.trim().equals("modify")) {
	String tele = request.getParameter("tele");
	String address = request.getParameter("address");
	user.setPhone(tele);
	user.setAddr(address);
	UserManager.update(user);
	out.print("ok");
}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="../css/register.css" rel="stylesheet"/>

</head>
<body>
<form action="usermodify.jsp" method="post" id="form1" name="form1">
<input type ="hidden" name="action" value="modify">
<table  border="1" width="600px" height="300px"  id="table">
	<tr > 
		
		<td colspan="3" textalign="center" id ="re" > <%=user.getUsername()%>用户修改</td>
	</tr>
	<!-- 
	<tr>
		<td style="width:100px">用户名：</td>
		<td><input type="text" name="name" id="name" style="width:250px" value="<%=user.getUsername()%>" />
		<span id="sname" style="width:200px"></span></td>
	</tr>
	 -->
	<!-- 
	<tr>
		<td style="width:100px">密码：</td>
		<td><input type="password" name="pswd1" id="pswd1" style="width:250px" value="<%=user.getPassword()%>"/>
		<span id="spswd" style="width:200px"></span></td>
	</tr>
	 -->
	<tr>
		<td style="width:100px">电话：</td>
		<td><input type="text" name="tele" id="tele" style="width:250px" value="<%=user.getPhone()%>"/>
		<span id="stele" style="width:200px"></span></td>
	</tr>
	<tr >
		<td style="width:100px">送货地址：</td>
		<td rowspan="3" ><textarea id="address" name="address" clos="8" rows="5" style="width:200px" ><%=user.getAddr() %></textarea>
			<span id="saddress" style="width:250px"></span></td>
		
	</tr>
	<tr></tr>
	<tr></tr>
	<tr></tr>
	<tr></tr>
	<tr>
		<td></td>
		<td colspan="2"><input type="submit" value="提交"/>
			<input type="reset" value="重置"/></td>
			<td></td>
	</tr>

</table>



</form>

</body>
</html>